<%@page contentType="text/html; charset=utf-8" %>
<%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="${ctx}/styles/aux_window.css" rel="stylesheet" type="text/css">
<%@ include file="/commons/validation.jsp" %>
<%@ include file="/commons/fileUpload.jsp" %>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript" defer="defer">
	<c:if test="${ !empty isEdit}">
		parent.areaObj.flushIframe();
		parent.areaObj.closeWindowOnCheck();
	</c:if>
    var hadtempChange=false;

	var formSerial = null;
	/*******处理是否能取消分期********/
	function checkAllowChangeHasProject(){
		var flag = document.getElementById('hasMoreProject').status;
		if(!flag){
			var url = "${ctx}/house_areaAction.do?method=changeHasMoreProject";
			new Ajax.Request(url,
		                    {method: 'post', parameters: null, onComplete: allowChangeHasProjectHandle}
		                    );
	    }
	}
	function allowChangeHasProjectHandle(result){
		var obj = result.responseText;
		if(obj == "true"){

		}else if(obj == "false"){
			ErrorAlert('${key.area_edit_faile}');
			document.getElementById('hasMoreProject').status = true;
		}
	}
	/****提交表单*****/
	function submitForm(){
		var flag = document.forms('areaForm').fireEvent("onSubmit");
		if(flag)
			document.forms.areaForm.submit();
		else
			parent.areaObj.setSaveClick();
	}
	/****判断是否能直接提交****/
	function allowClose(){
		var tempForm = $('areaForm').serialize();
		return tempForm == formSerial;
	}
	function init(){
		<c:if test="${ !empty isSave}">
			parent.areaObj.setSaveClick();  //设置按钮可用
			parent.areaObj.flushIframe(); //刷新父页面
		</c:if>

		$('hasMoreProject').checked = ${areavo.hasMoreProject eq '1'};
		parent.tabOption.hasProject(${areavo.hasMoreProject eq '1'});//设置是否有分期
		formSerial = $('areaForm').serialize();
	}

	function hadChange(){
		hadtempChange=true;
	}

	function getChange(){
		return hadtempChange;
	}

	function setChange(){
		hadtempChange=false;
	}

</script>
</head>
<body onload="setTimeout('init()',100);">
<form id="areaForm" name="areaForm" action="${ctx}/house_areaAction.do?method=editBase" method="post"  ENCTYPE="multipart/form-data" class="required-validate">
	<input id="isEdit" name="isEdit" value="" type="hidden">
	<input id="isSave" name="isSave" value="" type="hidden">
              <table width="100%" border="0" cellpadding="0" cellspacing="0" id="tab_subMenu1">
                <tr>
                  <td><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">

                      <tr>
                        <td>

                        <input type="hidden" name="keyword" value="${areavo.keyword}">
                        <table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">
                          <tr>
                            <td class="aux_intable_td1">楼盘名称：</td>
                            <td class="aux_intable_td2">${areavo.name}</td>
                          </tr>
                          <tr>
                            <td class="aux_intable_td1">楼盘地址：</td>
                            <td class="aux_intable_require"><input name="address" type="text" class="inputtext required validate-char" onChange="hadChange();" value="${areavo.address}"  size="16" maxlength="200"></td>
                          </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">交通位置图：</td>
                            <td class="aux_intable_td2">
	  							<mypms:ImageUpload name="trafficImage"
	  											   postfixName="trafficImage"
	  											   data="${areavo.trafficImage}"
	  											   imageType="jpg,gif"
	  											   maxSize="500"
	  											   >
	  							</mypms:ImageUpload>
                             </td>
                          </tr>
                          <tr>
                            <td class="aux_intable_td1">&nbsp;</td>
                            <td class="aux_intable_td2">
                            	<input name="hasMoreProject" type="checkbox"  id="hasMoreProject" onClick="checkAllowChangeHasProject();" value="select" >楼盘分期开发
                            </td>
                          </tr>
                        </table>
                        </td>
                      </tr>

                  </table>

                  </td>
                </tr>
              </table>
 </form>
</body>
</html>